package com.hspedu.homework.homework13;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/24
 * @time 20:07
 */
public class Teacher extends Person{
    private int work_age;

    public Teacher(String name, String sex, int age, int work_age) {
       super(name,sex,age);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }

    public String teach(){
        return "我承诺，我会认真教学";
    }

    @Override
    public String play() {
        return super.play() + "象棋";
    }

    @Override
    public String toString() {
        return "Teacher{" +
                super.toString() +
                "work_age=" + work_age +
                '}';
    }

    @Override
    public String printInfo(){
        return "老师的信息：+"
                + super.printInfo()
                +"\n工龄"+work_age
                +"\n"+teach()
                +"\n"+play();
    }

}
